package com.example.utils;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import org.apache.shardingsphere.core.strategy.keygen.SnowflakeShardingKeyGenerator;
import org.codehaus.groovy.control.SourceUnit;


/**
 * 生成雪花算法id工具类
 */
public class IDUtil {
    private static SnowflakeShardingKeyGenerator shardingKeyGenerator = new SnowflakeShardingKeyGenerator();
    /**
     * 雪花算法生成器
     * @return
     */
    public static Comparable<?> geneSnowFlakeID(){
        return shardingKeyGenerator.generateKey();
    }

}
